home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / PROGRAMR / OLE2BOOK.ZIP / CHAP06.ZIP / CHAP06 / COSCHMOO / MAKEFILE < prev    next >
Text File  |  1993-06-22  |  4KB  |  142 lines

  1. #
  2. # MAKEFILE
  3. # Component Schmoo Chapter 6
  4. #
  5. # Copyright (c)1993 Microsoft Corporation, All Rights Reserved
  6. #
  7. # Kraig Brockschmidt, Software Design Engineer
  8. # Microsoft Systems Developer Relations
  9. #
  10. # Internet  :  kraigb@microsoft.com
  11. # Compuserve:  >INTERNET:kraigb@microsoft.com
  12. #
  13.  
  14. #Add '#' to the next line for 'noisy' operation
  15. !CMDSWITCHES +s
  16.  
  17. #
  18. #Compiler flags
  19. #Use "SET RETAIL=1" from MS-DOS to compile non-debug version.
  20. #
  21. !ifndef RETAIL
  22. CFLAGS  = -c -nologo -Od -AM -Zipe -G2s -W3 -GA -GEs
  23. LINK    = /al:16/ONERROR:NOEXE/CO
  24. DEFS    = -DSTRICT -DDEBUG
  25. !else
  26. CFLAGS  = -c -nologo -Oas -AM -Zpe -G2s -W3 -GA -GEs
  27. LINK    = /al:16/ONERROR:NOEXE
  28. DEFS    = -DSTRICT
  29. !endif
  30.  
  31.  
  32. !ifdef SDI
  33. DOC     = -DSDI
  34. CLASSLIB= classSDI
  35. DIR     = SDI
  36. SRC_DIR = ..
  37. !else
  38. DOC     = -DMDI
  39. CLASSLIB= classMDI
  40. DIR     = MDI
  41. SRC_DIR = ..
  42. !endif
  43.  
  44.  
  45. .SUFFIXES: .h .obj .exe .cpp .res .rc
  46.  
  47. TARGET  = coschmoo
  48.  
  49. goal:   cd_build precomp.pch $(TARGET).exe cd_src
  50.  
  51. cd_build:
  52.     cd $(DIR)
  53.  
  54. cd_src:
  55.     cd ..
  56.  
  57. clean:
  58.     cd $(DIR)
  59.     del *.pch
  60.     del *.obj
  61.     del *.res
  62.     del *.exe
  63.     cd ..
  64.  
  65. PCHFLAGS= -Yu$(TARGET).h -Fpprecomp.pch
  66.  
  67. INCLS    = $(SRC_DIR)\$(TARGET).h $(SRC_DIR)\resource.h
  68. #CHAPTER5MOD
  69. OLELIBS  = compobj storage ole2
  70. LIBS     = libw mlibcew commdlg bttncur gizmobar stastrip $(CLASSLIB)
  71. #End CHAPTER5MOD
  72.  
  73. OBJS1    = $(TARGET).obj
  74. OBJS2    = client.obj
  75. OBJS3    = document.obj iadvsink.obj
  76. OBJS     = $(OBJS1) $(OBJS2) $(OBJS3)
  77.  
  78.  
  79. RCFILES1 = $(SRC_DIR)\$(TARGET).ico $(SRC_DIR)\document.ico $(SRC_DIR)\about.dlg
  80. RCFILES2 = $(SRC_DIR)\gizmo72.bmp $(SRC_DIR)\gizmo96.bmp $(SRC_DIR)\gizmo120.bmp
  81. RCFILES  = $(RCFILES1) $(RCFILES2)
  82.  
  83.  
  84.  
  85. #####
  86.  
  87. {$(SRC_DIR)}.cpp{}.obj:
  88.     echo ++++++++++
  89.     echo Compiling $*.cpp
  90.     cl $(CFLAGS) $(PCHFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  91.  
  92.  
  93. {$(SRC_DIR)}.rc{}.res:
  94.     echo +++++++++
  95.     echo Compiling Resources
  96.     rc -r -i$(SRC_DIR) $(DEFS) $(DOC) -fo$@ $(SRC_DIR)\$*.rc
  97.  
  98.  
  99. precomp.pch : $(SRC_DIR)\$(TARGET).h
  100.     echo +++++++++
  101.     echo Precompiling $(TARGET).h
  102.     cl $(CFLAGS) $(DEFS) -Yc$(TARGET).h -Fpprecomp.pch -Foprecomp $(SRC_DIR)\precomp.cpp
  103.  
  104.  
  105. #This rule builds a linker response file on the fly depending on debug flags
  106. $(TARGET).exe : $(OBJS) $(TARGET).res $(SRC_DIR)\$(TARGET).def
  107.     echo ++++++++++
  108.     echo Linking $@
  109.     echo precomp.obj +                           > $(TARGET).lrf
  110.     echo $(OBJS1) +                             >> $(TARGET).lrf
  111.     echo $(OBJS2) +                             >> $(TARGET).lrf
  112.     echo $(OBJS3)                               >> $(TARGET).lrf
  113.  
  114.     echo $(TARGET).exe $(LINK)                  >> $(TARGET).lrf
  115.     echo nul/li                                 >> $(TARGET).lrf
  116.     echo $(OLELIBS) +                           >> $(TARGET).lrf
  117.     echo $(LIBS) /NOD/NOE                       >> $(TARGET).lrf
  118.     echo $(SRC_DIR)\$(TARGET).def               >> $(TARGET).lrf
  119.  
  120.     link @$(TARGET).lrf
  121.     del $(TARGET).lrf
  122.     rc -v $(TARGET).res $(TARGET).exe
  123.  
  124.  
  125. ##### Dependencies #####
  126.  
  127. $(TARGET).res : $(SRC_DIR)\$(TARGET).rc $(INCLS) $(RCFILES)
  128.  
  129. #Application level things
  130.  
  131. #This rule is to exclude precompiled header use when INICLSID defined
  132. $(TARGET).obj : $(SRC_DIR)\$(TARGET).cpp $(INCLS)
  133.     echo ++++++++++
  134.     echo Compiling $*.cpp
  135.     cl $(CFLAGS) $(DEFS) $(DOC) $(SRC_DIR)\$*.cpp
  136.  
  137. client.obj    : $(SRC_DIR)\client.cpp    $(INCLS)
  138.  
  139. #Document level things
  140. document.obj  : $(SRC_DIR)\document.cpp  $(INCLS)
  141. iadvsink.obj  : $(SRC_DIR)\iadvsink.cpp  $(INCLS)
  142.